<?php

namespace app\admin\controller;

use think\Controller;
use think\Db;
use think\Request;
use think\Session;

class ZhuYe extends Controller{
   public function zhuye(){
       $data1 = Session::get('user');
       $id = $data1['id'];
       $data = Db::query('select * from user1 join role on role_id = role.id join login on login.id = role.id WHERE login.id=?',[$id]);
       return $data;
   }
   public function kehu(){
       $data = Db::query('select * from information');
       return $data;
   }
    public function huiyuan(){
        $data = Db::query('select * from relation join user on userid=user.id join level on levelid=level.id join information on user_id=user.id where levelid!=1;');
        return $data;
    }
    public function nhuiyuan(){
        $data = Db::query('select * from relation join user on userid=user.id join level on levelid=level.id join information on user_id=user.id where levelid=1;');
        return $data;
    }
    public function dingdan(){
        $data = Db::query('select * from goumai join shop on shopsid = shop.id join information on information_id=information.id');
        $data1 = Db::query('select information.name,xifen.name as name1,information.id,goumai1.zhuangtai,information.address from goumai1 join xifen on xifensid = xifen.id join information on information_id=information.id');
        return [$data,$data1];
    }
}
